<template>
  <div v-text="value"></div>
</template>

<script>
export default {
  name: 'Radio',
  props: {
    option: {
      type: Object,
      required: false,
      default: () => {
        return {
          options: []
        };
      }
    },
    fieldValue: {
      type: String,
      required: false,
      default: () => {
        return undefined;
      }
    }
  },
  computed: {
    value() {
      if (this.option.options && this.option.options.length === 0) {
        return '未知';
      }
      let result = this.option.options.filter(item => item.value === this.fieldValue);
      return (result && result.length > 0) ? result[0].label : '未知';
    }
  }
}
</script>

<style scoped>

</style>